<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCafesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cafes', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->nullable(false)->default('')->comment('名称');
            $table->string('address',300)->nullable(false)->default('')->comment('地址');
            $table->string('city',50)->nullable(false)->default('')->comment('城市');
            $table->string('state',50)->nullable(false)->default('')->comment('省');
            $table->string('zip')->nullable(false)->default('')->comment('邮编');
            $table->decimal('latitude', 11, 8)->nullable(false)->default(0)->comment('纬度');
            $table->decimal('longitude', 11, 8)->nullable(false)->default(0)->comment('经度');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cafes');
    }
}
